﻿using XiaoyuI.CrystalQuartz.Domain.Activities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace XiaoyuI.Quartz.WinManager
{
    public class SchedulerNode : TreeNode
    {
        public SchedulerNode(QuartzScheduler scheduler)
            : base()
        {
            this.Text = scheduler.Address;
            Scheduler = scheduler;
        }
        public QuartzScheduler Scheduler { get; private set; }

    }
    public class JobNode : TreeNode
    {
        public JobNode(JobData job)
            : base()
        {
            this.Text = job.Name;
            Job = job;
        }
        public JobData Job { get; private set; }

    }

    public class JobDetails
    {
        public string Description { get; set; }

        public bool ConcurrentExecutionDisallowed { get; set; }

        public bool PersistJobDataAfterExecution { get; set; }

        public bool RequestsRecovery { get; set; }

        public bool Durable { get; set; }

        public Type JobType { get; set; }
    }

    public class JobDetailsData
    {
        public JobDetailsData(JobDetails jobDetails, IDictionary<string, object> jobDataMap)
        {
            JobDetails = jobDetails;
            JobDataMap = jobDataMap;
        }

        public JobDetails JobDetails { get; }

        public IDictionary<string, object> JobDataMap { get; }
    }
}
